package com.tanhua.dubbo.api.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tanhua.dubbo.api.OptionApi;
import com.tanhua.dubbo.mapper.OptionMapper;
import com.tanhua.dubbo.pojo.Option;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

@DubboService(version = "1.0.0")
public class OptionApiImpl implements OptionApi {
    @Autowired
    private OptionMapper optionMapper;

    @Override
    public Option queryByOptionId(Long id) {
        return this.optionMapper.selectById(id);
    }

    @Override
    public List<Option> queryBySoulQuestionId(Long soulQuestionId) {
        QueryWrapper<Option> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("soul_question_id",soulQuestionId);
        return this.optionMapper.selectList(queryWrapper);
    }



}
